From: Happy-melon Date: Fri, 11 Mar 2011 23:42:53 +0000 (+0000) Subject: add __toString() call for User objects, returning User->getName(). Now that we requi... X-Git-Tag: 1.31.0-rc.0~31510 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=cc941ed637e1e9d09f4d32cc6a06186db0ddb057;p=lhc%2Fweb%2Fwiklou.git add __toString() call for User objects, returning User->getName(). Now that we require PHP 5.2+, we can do this with all our major classes... :D --- diff --git a/includes/User.php b/includes/User.php index 111ed3ab2a..5418a0d3f2 100644 --- a/includes/User.php +++ b/includes/User.php @@ -203,6 +203,10 @@ class User { $this->clearInstanceCache( 'defaults' ); } + function __toString(){ + return $this->getName(); + } + /** * Load the user table data for this object from the source given by mFrom. */